package org.xmonkey.notifier.model;

import org.eclipse.core.resources.IProject;
import org.eclipse.jdt.core.dom.ASTNode;

/**
 * This interface describes what a subscriber will do.
 * It will react to visits and events, provide a name and a notification order.
 * @author jacopom
 *
 */
public interface ISubscriber {
	
	/**
	 * This method is called by X-Monkey for each client registered to a specific node visit
	 * @param project the project to monitor for AST visits
	 * @param node the visited node
	 */
	public void reactToVisit(IProject project, ASTNode node);
	
	/**
	 * This method is called by X-Monkey for each client registered to a end-of-visit event
	 * @param project the project
	 */
	public void reactToEnd(IProject project);
	
	/**
	 * This method is called by X-Monkey for each client registered to a start-of-visit event
	 * @param project the project
	 */
	public void reactToStart(IProject project);
	
	/**
	 * Returns an int that will be used to sort this object against other ISubscriber objects to 
	 * compute the order of notifications
	 * @return the notification order for this object
	 */
	public int getSubscriberOrder();
	
	/**
	 * Retrns the name of the subscriber
	 * @return the name of the subscriber
	 */
	public String getSubscriberName();
	

}
